package com.cyq.day17.Demo7;

public class Test {
    public static void main(String[] args) {
        Computer computer=new Computer();
        powerOn(computer);
        powerOff(computer);

    }
    public static void powerOn(Computer computer){
        computer.add();
        for (int i = 0; i <computer.usb.length ; i++) {
            computer.usb[i].turnOn();
        }
        System.out.println("计算机开机成功");

    }
    public static void powerOff(Computer computer){
        for (int i = 0; i <computer.usb.length ; i++) {
            computer.usb[i].turnOff();
        }
        System.out.println("计算机关机成功");

    }

}
